import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'


import HomeContainer from './components/tabbar/HomeContainer.vue'
import MemberContainer from './components/tabbar/MemberContainer.vue'
import SearchContainer from './components/tabbar/SearchContainer.vue'
import ShopcarContainer from './components/tabbar/ShopcarContainer.vue'


/* new列表 */
import newslist from './components/news/newslist';
import newsinfo from './components/news/newsInfo';

/* 图片列表 */
import  photolist  from  "@/components/photo/photolist"
import  photoinfo  from  "@/components/photo/photoinfo"

Vue.use(Router)

export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [
    {path:"/",redirect:"/home"},
    {
      path: '/home',
      name: 'home',
      component: HomeContainer
    },

    {
      path: '/member',
      name: 'member',
      component: MemberContainer
    },
    {
      path: '/search',
      name: 'search',
      component: SearchContainer
    },
    {
      path: '/shopcar',
      name: 'search',
      component: ShopcarContainer
    },
/* news的newlist */
    {
      path: '/home/newslist',
      name: 'newslist',
      component: newslist
    },

    {
      path: '/home/newsinfo/:id',
      name: 'newslist',
      component: newsinfo
    }, 
/* 图片列表 */
    {
      path: '/home/photolist',
      name: 'photolist',
      component: photolist
    },
    
    {
      path: '/home/photoinfo/:id',
      name: 'photoinfo',
      component: photoinfo
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import(/* webpackChunkName: "about" */ './views/About.vue')
    }
  ],
  linkActiveClass:"mui-active"
})
